const express = require('express');
const cors = require('cors');
const bodyParser = require('body-parser');
let app = express();
app.use(cors());
app.use(bodyParser.json());
app.use(bodyParser.text());
app.use(bodyParser.urlencoded({ extended: false }));
// 引入公共模块 方法
const {
    UpLoad,
    up
} = require('./api/common')
// 上传文件
app.post('/upload',up.single('file'),UpLoad);
const {
    GetCategory,
    SetDuckAndSku,
    SetCategary,
    SetBanner
} = require("./adminApi/index");
app.get('/admin/getCategary',GetCategory)
app.post('/admin/SetDuckAndSku',SetDuckAndSku)
app.post('/admin/SetCategary',SetCategary)
app.post('/admin/SetBanner',SetBanner)
app.listen('8888');